<script lang="ts" setup>
// import { ref } from 'vue'
import { useRouter,useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
import {useOrderStore} from '@/stores/order'
const orderStore = useOrderStore()


// 支付方式枚举
// enum PaymentMethod {
//   WXPAY, // 微信支付
//   ALIPAY, // 支付宝支付
//   UNIONPAY, // 银联线上支付
//   ACCOUNT, // 账户余额支付
//   DELIVERY // 货到付款
// }

//支付方式
const paymoney=(e:any)=>{
 
  orderStore.payOrder(route.params.id, e.target.dataset.id)

}

</script>

<template>
  <van-nav-bar fixed title="支付结算" left-arrow @click-left="router.go(-1)" />
  <div class="payorder">
    <div>请选择你的支付方式</div>
    <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }"> </van-divider>
   <div @click="paymoney">
    <van-button type="primary" data-id="0" block>微信支付</van-button>
    <van-button type="success" data-id="1" block>支付宝支付</van-button>
    <van-button color="#7232dd" data-id="2" block>银联线上支付</van-button>
    <van-button type="warning" data-id="3" block>账户余额支付</van-button>
    <van-button type="danger" data-id="4" block >货到付款</van-button>
   </div>
  </div>
</template>

<style scoped lang="less">
.payorder {
  margin-top: 46px;
  padding: 0 16px;
  
}
</style>
